:root {
  /* 主题颜色 - 中药系统自然风格 */
  --primary-color: #8f5733; /* 中药材红棕色 */
  --primary-light: #a06f4c;
  --primary-dark: #704527;
  --secondary-color: #2a665a; /* 中药草本绿色 */
  --secondary-light: #3a7d6f;
  --secondary-dark: #1f4d42;
  --accent-color: #d9a053; /* 中药干品金黄色 */
  
  /* 明亮主题 */
  --bg-color: #f7f5f2;
  --text-color: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --scrollbar-track: #f0f0f0;
  --scrollbar-thumb: #ccc;
  --scrollbar-thumb-hover: #aaa;
  
  /* 其他全局变量 */
  --header-height: 60px;
  --sidebar-width: 200px;
  --border-radius: 8px;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;

  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 暗色主题 */
.dark-theme {
  --bg-color: #1e1e1e;
  --text-color: #f0f0f0;
  --text-secondary: #cccccc;
  --text-tertiary: #999999;
  --card-bg: #2d2d2d;
  --border-color: #444444;
  --scrollbar-track: #333333;
  --scrollbar-thumb: #555555;
  --scrollbar-thumb-hover: #777777;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'SimSun', 'STSong',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-color);
}

p {
  margin-bottom: 1em;
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}

/* 辅助类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* 过渡动画 */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { 
    transform: translateY(20px);
    opacity: 0;
  }
  to { 
    transform: translateY(0);
    opacity: 1;
  }
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 2px 4px;
  border-radius: 3px;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
